package com.xiaoma.weblog.admin.event;

import lombok.Getter;
import org.springframework.context.ApplicationEvent;

/**
 * @ClassName PublishArticleEvent
 * @Description:
 * @Author: 小马
 * @CreateDate: 2025/4/1 14:08
 * @Version: 1.0
 */
@Getter
public class PublishArticleEvent extends ApplicationEvent {

    /**
     * 文章 ID
     */
    private Long articleId;

    public PublishArticleEvent(Object source, Long articleId) {
        super(source);
        this.articleId = articleId;
    }


//    @Autowired
//    private ApplicationEventPublisher eventPublisher;
//
//    /**
//     * 发布文章
//     *
//     * @param publishArticleReqVO
//     * @return
//     */
//    @Override
//    @Transactional(rollbackFor = Exception.class)
//    public Response publishArticle(PublishArticleReqVO publishArticleReqVO) {
//        // 省略...
//
//        // 发送文章发布事件
//        eventPublisher.publishEvent(new PublishArticleEvent(this, articleId));
//
//        return Response.success();
//    }
}
